package Controller.MusicLike;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.joinHadoopBean;
import Dao.MusicLikeDao;

public class TenYearsContoller implements Controller{
	private MusicLikeDao dao;
	
	public void setDao(MusicLikeDao dao) {
		this.dao = dao;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		System.out.println("10대 노래 성별 컨트롤러");
		
		List<joinHadoopBean> tenyears = dao.tenyears();
		for (joinHadoopBean joinHadoopBean : tenyears) {
			System.out.println("=======================");
			System.out.println(joinHadoopBean.getMusicbean().getMs_title());
			System.out.println(joinHadoopBean.getMusicalbean().getMla_count());
			System.out.println("=======================");
		}
		ModelAndView mav = new ModelAndView();
		mav.setViewName("tenyears");
		mav.addObject("tenyears",tenyears);
		
		return mav;
	}

}
